package com.sgb.kjwl.viewmodel.material;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;

import com.sgb.kjwl.api.APIManager;
import com.swgk.core.base.api.ICallBack;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.common.base.BaseViewModel;
import com.swgk.core.view.entity.MenuEntity;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class GoodsAggregateViewModel extends BaseViewModel {

    public MutableLiveData<List<MenuEntity>> listdata = new MutableLiveData<>();

    public GoodsAggregateViewModel(@NonNull @NotNull Application application) {
        super(application);
    }

    public void recommendMenu() {
        mLoading.postValue(SHOW_LODING);
        APIManager.getInstance().getMaterialAPI().recommendMenuNew().enqueue(new ICallBack<BaseEntity<List<MenuEntity>>>() {
            @Override
            public void onSuccess(BaseEntity<List<MenuEntity>> data) {
                mLoading.postValue(DISMISS_LODING);
                listdata.postValue(data.getData());
            }
        });
    }

}
